﻿using System;
using System.Collections;
using System.Collections.Generic;
using C5;
using COC.Character.Extra;
using COC.Exception;
using UnityEngine;

namespace COC.Tools.Pathing
{
    public class CPathPool
    {
        public ArrayList<CPath> allPath=new ArrayList<CPath>();

        public void registerPath(CPath p)
        {
            if(!allPath.Contains(p))
                allPath.Add(p);
            else
            {
                UnityEngine.Debug.LogWarning("there has already exsit one:"+p.id+" in path pool.");
            }
        }
        public void recycle(CPath path)
        {
            if (allPath.Contains(path))
            {
                allPath[allPath.IndexOf(path)].reset();
            }
             

        }
    }
}
